package com.ysd.lis.controller.lab;


import com.ysd.common.Result;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.request.AddFeeItemVsBarCodeParam;
import com.ysd.lis.request.DeleteFeeItemVsBarCodeParam;
import com.ysd.lis.service.lab.LabFeeitemVsBarcodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 条码类别与申请收费项目对照表
 * 前端控制器
 * </p>
 *
 * @author LiuQi
 * @since 2023-12-15
 */
@Api(tags = "条码类别和申请项目对照")
@RestController
@RequestMapping("/lis/feeVsBar/barcode")
public class LabFeeitemVsBarcodeController extends BaseController {

    @Autowired
    public LabFeeitemVsBarcodeService labFeeitemVsBarcodeService;

    @ApiOperation("添加对照关系")
    @PostMapping("/addFeeItemBarCode")
    @LogDetail(requestParam ="addFeeItemBarCode",operationType = OperationType.INSERT, module = "条码类别和申请项目对照",content = "增加【feeName】对应关系", businessName = "feeName")
    public Result addFeeItemBarCode(@RequestBody AddFeeItemVsBarCodeParam addFeeItemVsBarCodeParam) {
        return labFeeitemVsBarcodeService.addFeeItemBarCode(addFeeItemVsBarCodeParam);
    }

    @ApiOperation("删除对应关系")
    @PostMapping("/deleteFeeItemBarCode")
    @LogDetail(requestParam ="deleteFeeItemBarCode",operationType = OperationType.DELETE, module = "条码类别和申请项目对照",content = "删除【feeName】对应关系", businessName = "feeName")
    public Result deleteFeeItemBarCode(@RequestBody DeleteFeeItemVsBarCodeParam deleteFeeItemVsBarCodeParam) {
        return labFeeitemVsBarcodeService.deleteFeeItemBarCode(deleteFeeItemVsBarCodeParam);
    }

    @ApiOperation("移动数据")
    @PostMapping("/updateMoveSeq")
    public Result updateMoveSeq(@RequestBody List<String> ids) {
        return labFeeitemVsBarcodeService.updateMoveSeq(ids);
    }
}
